/*
 * @lc app=leetcode.cn id=171 lang=csharp
 *
 * [171] Excel 表列序号
 */

// @lc code=start
public class Solution {
    public int TitleToNumber(string columnTitle) {
        int res = 0;
        for (int i = 0; i < columnTitle.Length; i++)
        {
            res = res * 26 + columnTitle[i] - 'A' + 1;
        }
        return res;
    }
    
    /*
    
    14623
    ans = 0
    n = 1
    
    ans += i * n
    n *= 10
    
    */
}
// @lc code=end

